package com.excellent.mapper;

import com.excellent.entity.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserMapper {
    @Select("SELECT * FROM user")
    List<User> findAll();

    @Insert("INSERT INTO user(name) VALUES(#{name})")
    void insert(User entity);

    @Update("UPDATE user SET name=#{name} WHERE id=#{id}")
    void update(User entity);

    @Delete("DELETE FROM user WHERE id=#{id}")
    void delete(Long id);
}